UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OzWnUOX+HOs7cr2VPMgxh4odTaPCWlS5AEqzx99hRQg='
WHERE
key_id = '68a4222b152c21f022836b9cf55f478de3fb91ed8cee7fa1ba31f51082c28fa3'
AND (
token = 'OzWnUOX+HOs7cr2VPMgxh4odTaPCWlS5AEqzx99hRQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)