UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'faWXutvZF6w37X9d/i+h4DPZuPrXBxnDAockoIKCGlA='
WHERE
key_id = '5bc22bc4f6ac74e3420beb63a983d9ce6cde3263a1990c034a074a9de051b7e8'
AND (
token = 'faWXutvZF6w37X9d/i+h4DPZuPrXBxnDAockoIKCGlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)