UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UARk0gB5fIRAlryIWXYYZLuAxfAhrHfH2cZZ3Ru+AQs=' 
WHERE 
  key_id = '991800b1f1085e4e6b4d8860aa83f848d063225b329ab8fd225bc2c82926dcaf' 
  AND (
    token = 'UARk0gB5fIRAlryIWXYYZLuAxfAhrHfH2cZZ3Ru+AQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034