UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yA39mbUR5ezpkBCVmXso6Yp3YZio/LRavEkS1hAWtbc=' 
WHERE 
  key_id = '07cd0d489af17925c9d4338627e056fe28ffb1d2349cb61de42be2c2f59aa86a' 
  AND (
    token = 'yA39mbUR5ezpkBCVmXso6Yp3YZio/LRavEkS1hAWtbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030