UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '69mJmnz3CLo+4b84LahF812vdyTg6P4wI0qGJn8cXQQ=' 
WHERE 
  key_id = 'd37324777e8ab01fd423fa51021a03788618b1f5b6c0fe1b981b68bd2d133c8e' 
  AND (
    token = '69mJmnz3CLo+4b84LahF812vdyTg6P4wI0qGJn8cXQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032