UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IOnECjwh8y1LUoC/aI77awlQ9p9MMkIe0u1RbohGJJE='
WHERE
key_id = 'a30b2b9f97e8184f0f82e955fe86a24998d88e3b471748a59bfdc41c5c4f395a'
AND (
token = 'IOnECjwh8y1LUoC/aI77awlQ9p9MMkIe0u1RbohGJJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)