UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NS6kreqn/Ko4RbWyBdT7ForrZB+6IdqzRxHAJmtjHbc=' 
WHERE 
  key_id = 'fd7e63e823059fb840f9cbe1c46f015aa1b2b097cf9c196d040d789f84ba002b' 
  AND (
    token = 'NS6kreqn/Ko4RbWyBdT7ForrZB+6IdqzRxHAJmtjHbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024