UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '58AXvNBJJryFbsP5ZcUr4eSiqeOGy8zJTLg3R4eG4c4=' 
WHERE 
  key_id = 'db884c5de4f88eae7e0751a2389e6d37aff518c6a24fedab5c675c8bebd6c41e' 
  AND (
    token = '58AXvNBJJryFbsP5ZcUr4eSiqeOGy8zJTLg3R4eG4c4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053