UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Db86Vs/886cdP2S+sBtNxFpqnUYubkiTdtADXV9hqBQ='
WHERE
key_id = '896ec547e8616ac5c71b188dbfeb24c3d208a35bc29b1b1477369dabdc942650'
AND (
token = 'Db86Vs/886cdP2S+sBtNxFpqnUYubkiTdtADXV9hqBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)