UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fl9PyI980tZhy6+EbadyGg6rxty9CKV/UKiuz7H1ziU='
WHERE
key_id = '98e6afc461a1b1be1303aa4d7f6180c565cab26cf994bdc15df1873e5286f3dd'
AND (
token = 'Fl9PyI980tZhy6+EbadyGg6rxty9CKV/UKiuz7H1ziU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)