UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rvqTaIiJMYsSpIZAibEY8ynv0CZo0o6qPvhHXZq4caE='
WHERE
key_id = '662e6e8e2e3df293b293940fd759fc9b53b2943c1e7564b27e5cd52c2a694b0b'
AND (
token = 'rvqTaIiJMYsSpIZAibEY8ynv0CZo0o6qPvhHXZq4caE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)