UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oIAascr5c8x1u43c8V7xTKxgt+N/Ui9s0LG9QxiBL40=' 
WHERE 
  key_id = '7e73488ccdab56a7b303ae582efc7ae0b2a5c8f0e9bf26603907226f1d13a90e' 
  AND (
    token = 'oIAascr5c8x1u43c8V7xTKxgt+N/Ui9s0LG9QxiBL40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023