UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2oRjAPwtiqxf/EVgf1wxTVF9K7+Kz6rBnmLGKmik6E=' 
WHERE 
  key_id = '2bce35f6e9a6adfb8517fd29e979fdaf59da09ef493ea31b785390b5a43a7ec4' 
  AND (
    token = 'f2oRjAPwtiqxf/EVgf1wxTVF9K7+Kz6rBnmLGKmik6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022