UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KuuSs2QS5RQZDvEiBuNqLqGqIFeuwyxoBXyrQRHz6fs=' 
WHERE 
  key_id = '73778cc650628315170c7c7a390ac9e73b2682c9f11c1238bdea7fb60557b627' 
  AND (
    token = 'KuuSs2QS5RQZDvEiBuNqLqGqIFeuwyxoBXyrQRHz6fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015