UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fRt6xmhOLvlPYShksh4lHjyfDg6ysySst0C6CJgNsHs=' 
WHERE 
  key_id = '10e0f9d8c2037cf2ad67ba3dcfb9eea30c95182c211e605fc3f017508ae91213' 
  AND (
    token = 'fRt6xmhOLvlPYShksh4lHjyfDg6ysySst0C6CJgNsHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020