UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vMq7LlX56VrJ82e3MRLp/a74NeuST9Q4iB1JisCo5ho=' 
WHERE 
  key_id = '28ef05bcb46da0a2b8a85c2fd87802b1de6ec874e579e690cdf8422a35df582b' 
  AND (
    token = 'vMq7LlX56VrJ82e3MRLp/a74NeuST9Q4iB1JisCo5ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049