UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fGUwg1dNoa9C7YT6Zky7bJ8nXO98XN5mR6cXrkl7wkE='
WHERE
key_id = 'b3cb28f04971a2530020fe3656223faea58f35ac4a36fad1bc088c8cde80934a'
AND (
token = 'fGUwg1dNoa9C7YT6Zky7bJ8nXO98XN5mR6cXrkl7wkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)