UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dEF4OxcKzNvw9LSE2149xJ8f1qkFGksW7ZndP9evkO4=' 
WHERE 
  key_id = '803a135270d19563490225bc5c82a830fde4a106cab54b01d6020912394e3425' 
  AND (
    token = 'dEF4OxcKzNvw9LSE2149xJ8f1qkFGksW7ZndP9evkO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018