UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZqvfYVPTQu+ftAtUOJP2WFF76Tvx5USTO8SxfnbnMng='
WHERE
key_id = '0fde4cf9a510f87ffe205b41fb07921aee066e94be539680490774a483681506'
AND (
token = 'ZqvfYVPTQu+ftAtUOJP2WFF76Tvx5USTO8SxfnbnMng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)