UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+B/Nzkx4Sr3Eo2COAsudsGWbBoD6M6QDIEoXhZqF3uo='
WHERE
key_id = 'bdfde45a6ce14d3a6d6960fb0fac7f5017f4e0001477a22f9acef9d91c036eb4'
AND (
token = '+B/Nzkx4Sr3Eo2COAsudsGWbBoD6M6QDIEoXhZqF3uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)