UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6dc1sygXgUm4zwVj7AKRrzPdTlVHFAzr0zUyIre2LHg=' 
WHERE 
  key_id = '2b4025aaf8c30a6f5cdac7f3b1f6ae89ccac4f538ab8e17d625e927cabf25483' 
  AND (
    token = '6dc1sygXgUm4zwVj7AKRrzPdTlVHFAzr0zUyIre2LHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030