UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3cV4MovTpNEF8irIfB/bB1sI664JXqoW8/YZNxxAG4U='
WHERE
key_id = '3f4fb227223a3ed6ef23d9685d88b4f9d4f686f2d096dd0f3eba1bb8de384c3c'
AND (
token = '3cV4MovTpNEF8irIfB/bB1sI664JXqoW8/YZNxxAG4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)