UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uaAH8WtU+CWAuHkDAsBKye7mXj9JMypWXp51UpuYir0='
WHERE
key_id = 'c3eaff69f597ef237929a3a7dc2e644f297c17c87db75abe69bf4eb1b71ae417'
AND (
token = 'uaAH8WtU+CWAuHkDAsBKye7mXj9JMypWXp51UpuYir0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)