UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FXjYlqU4jC0nTofk+X4AIj/qHi6SK9E6Ow7NzXtTk1Y=' 
WHERE 
  key_id = '1ff1c19e17ed571d6e871c35767983691f40b452caa80a0ce8fccefc1d962d24' 
  AND (
    token = 'FXjYlqU4jC0nTofk+X4AIj/qHi6SK9E6Ow7NzXtTk1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041