UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qw2X2f5N6mwht8GpUQk7vNndsH4p8oc4gQ8M61lLxNE=' 
WHERE 
  key_id = '530af44a82851ab048caad6445da5b20ea2b00bfdea995397bd4d1a9fdfbea2a' 
  AND (
    token = 'qw2X2f5N6mwht8GpUQk7vNndsH4p8oc4gQ8M61lLxNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041