UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x11DLzyUy+ggWfKR24CbL/Bullf1FM+U5+VcSa8yBrI=' 
WHERE 
  key_id = '68ef91888580b78f850d416b8bee2f0d7475adc640901dbc95adec8ed5b044b5' 
  AND (
    token = 'x11DLzyUy+ggWfKR24CbL/Bullf1FM+U5+VcSa8yBrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041