UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8kmW0IaElOR22RBWkYavYsh1E1EtYUF0gIOQnohODls=' 
WHERE 
  key_id = '5cb9b2b052c436c8fbcda7292fcbcbbb4090dea7cadfee5dd9f756412c3ad689' 
  AND (
    token = '8kmW0IaElOR22RBWkYavYsh1E1EtYUF0gIOQnohODls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035