UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SEcg7u3+VUUWmJkHDj9qucPT/FLP+NnUfW0CkmhTg3Q='
WHERE
key_id = 'f808b938ee4f06bc4e2d118f039992b7cffd3ee457f07ceec1eb504f5a6c54d4'
AND (
token = 'SEcg7u3+VUUWmJkHDj9qucPT/FLP+NnUfW0CkmhTg3Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)