UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XISFOy6QLZYQP0Rck/sGCjTxqeJ+1H13cOX6pPeWFcc='
WHERE
key_id = '9decc225face46139c496733d4c4d80db49f1ae08dcabe0639b5cd87510e6cdd'
AND (
token = 'XISFOy6QLZYQP0Rck/sGCjTxqeJ+1H13cOX6pPeWFcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)