UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H5T2FKYYzhWg6Mn8ej/k7EhKgEJlZOqON4ympxbDbFw=' 
WHERE 
  key_id = '92b3d6a96e1a43e5f42c56f5d067d276510b1cded3e47b11199dd80e32e2762b' 
  AND (
    token = 'H5T2FKYYzhWg6Mn8ej/k7EhKgEJlZOqON4ympxbDbFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033