UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G86l9ZG8R9nOnCFTi/OyXVFE2bBNZkB+qTrEZ1oiNaY='
WHERE
key_id = 'dae8c39cbf742100a3ded4b1357ce5f49ec3bc1f80f651cb89aea334916b1a19'
AND (
token = 'G86l9ZG8R9nOnCFTi/OyXVFE2bBNZkB+qTrEZ1oiNaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)