UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RCElJLCms285V4bd2ZGa5n14ASb2/d3x6UTVtd+IH8I=' 
WHERE 
  key_id = '71ed033b648ed14f8b23a3c836830bf88060b8583d614d18541fcbfaffa7334a' 
  AND (
    token = 'RCElJLCms285V4bd2ZGa5n14ASb2/d3x6UTVtd+IH8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063