UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FG4ZZphAExclPlSc2JkAq9ulKXskASShdHx90BPPH3w=' 
WHERE 
  key_id = 'c8cdb3ea186a93345b6fb0bd51a3168825eaedc27ece3de74d1739cb0362009a' 
  AND (
    token = 'FG4ZZphAExclPlSc2JkAq9ulKXskASShdHx90BPPH3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017