UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UkCxfqIJ9GWmLszd4pNa2IWrHLgEYyCnNelQjj17IO0='
WHERE
key_id = '549f6856b5d4b15cbdb18fe4f31b3e7ff0b52ca354b17dce75fe0b5dbf9b7e8a'
AND (
token = 'UkCxfqIJ9GWmLszd4pNa2IWrHLgEYyCnNelQjj17IO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)