UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmFa/EQYOeIqnc9IwZXOMyZK2oqKK21ch2/acjfrms0='
WHERE
key_id = 'b9e61dd16eeca646e29dea75b626c77d3a66d16bc99a2b54dd8b2d31dda8faab'
AND (
token = 'mmFa/EQYOeIqnc9IwZXOMyZK2oqKK21ch2/acjfrms0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)