UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TRBUf5oyCi62RmKtOXZm4RrgTZcP8XzDrT3uL70wlBM=' 
WHERE 
  key_id = '07f0144cafa216909c74153fa5e3f6293507fe8c1920666544ab2e2d3853a4da' 
  AND (
    token = 'TRBUf5oyCi62RmKtOXZm4RrgTZcP8XzDrT3uL70wlBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034