UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '00DvXZREWN7XSvUZanoL4QisBe34Xvz4aN6+NRVL9Iw=' 
WHERE 
  key_id = '35ca5d459bbcbd2619cde030d2850bcb0b5704e1ee05e1bfa2e067d25f2c4eaa' 
  AND (
    token = '00DvXZREWN7XSvUZanoL4QisBe34Xvz4aN6+NRVL9Iw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031