UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V8dG8Rf7GiFXccM/ov6IJsn4TJFHhHCjfBomftBUah0='
WHERE
key_id = 'fce8da921812aade7f3d12427d5d4110f4b673760a9e4f5008dced6910d7e245'
AND (
token = 'V8dG8Rf7GiFXccM/ov6IJsn4TJFHhHCjfBomftBUah0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)