UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rx/wfzOEs8nipZpAg8ZbfsCjv7v4vIa8JqD41NWz4U='
WHERE
key_id = '2a6ae124316302b05399c03350e24906e7a519eaa6f037ae4e89b5069b6655fb'
AND (
token = '3rx/wfzOEs8nipZpAg8ZbfsCjv7v4vIa8JqD41NWz4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)