UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NKjmmd/d+1iEjEZI0gAXpB55b2X2B2ZeHhp7JmMrXuc=' 
WHERE 
  key_id = 'd868e0272756e3cce08f03bdd597945ba33167b232b3a56ccacaf3ee76cac31b' 
  AND (
    token = 'NKjmmd/d+1iEjEZI0gAXpB55b2X2B2ZeHhp7JmMrXuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036