UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kYGAsRAAE2/YaxlWncLLs/hNUx65TG1qyE7gRKPwHPU=' 
WHERE 
  key_id = 'fb9d03fba2cd98137b447d8051b8bcb9212982d454838247c8833ed65dba5e06' 
  AND (
    token = 'kYGAsRAAE2/YaxlWncLLs/hNUx65TG1qyE7gRKPwHPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020