UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZyIOcFCnfzZGnB6nJR5kILtxbRrtOoi22DZvFZ9xTpE='
WHERE
key_id = '7288924563f9b69901f2058814e5739aa3ac99950d9aaaf6f3b9bd8e7599ab0a'
AND (
token = 'ZyIOcFCnfzZGnB6nJR5kILtxbRrtOoi22DZvFZ9xTpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)