UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'io+nqa6V9EbR+gnpIEdZ96yqv8DVm/whUFU1AYrXjwM='
WHERE
key_id = 'f771b4b146dc3bc8433e20cdd89851233554e4fa1d129bb9ba7e3498f4c42b2c'
AND (
token = 'io+nqa6V9EbR+gnpIEdZ96yqv8DVm/whUFU1AYrXjwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)